<div class="title">商品分类</div>
<div class="top-button">
	相关操作：<a href="{:U('Category/add')}" class="light">添加分类</a>
</div>
<div class="list full auto">
	<table>
		<tr><th>分类名称</th><th>操作</th></tr>
		<foreach name="category" item="v">
			<tr><td>{:str_repeat('— ',$v['level'])}{$v.name}</td><td><a href="{:U('Category/edit',array('id'=>$v['id']))}">修改</a>　<a href="#" class="act-del" data-id="{$v.id}" >删除</a></td></tr>
		</foreach>
	</table>
</div>
<form method="post" id="form">
	<input type="hidden" name="id" id="target_id">
</form>
<script>
	//删除
	$(".act-del").click(function(){
		if(confirm('确定要删除吗？（该分类下的商品将归于未分类）')){
			$("#target_id").val($(this).attr("data-id"));
			$("#form").attr("action","{:U('Category/del')}").submit();
		}
	});
</script>